package com.eastcom.dataquality.core.dao.impl;

import javax.sql.DataSource;

import com.eastcom.dataquality.core.dao.BaseDao;
import com.eastcom.dataquality.core.dao.BusinessQuery;
import com.eastcom.dataquality.core.dao.DBSourceDao;
import com.eastcom.dataquality.core.dao.DaoFactory;
import com.eastcom.dataquality.core.dao.DataAbnormalDao;
import com.eastcom.dataquality.core.dao.DatasetDefineDao;
import com.eastcom.dataquality.core.dao.DayStatisDao;
import com.eastcom.dataquality.core.dao.KpiDefineDao;
import com.eastcom.dataquality.core.dao.MsgSubDao;
import com.eastcom.dataquality.core.dao.RawDataDao;
import com.eastcom.dataquality.core.dao.ScanJobDao;
import com.eastcom.dataquality.core.dao.SmoothDefineDao;
import com.eastcom.dataquality.core.dao.SmoothEventDao;
import com.eastcom.dataquality.core.dao.SmoothStrategyDao;
import com.eastcom.dataquality.core.dao.TimeCheckDao;

public class DefaultDaoFactory implements DaoFactory{

	private DataSource dataSource;
	
	public DataAbnormalDao getAbnormalDao() {
		DataAbnormalDao ret=new DataAbnormalDao();
		ret.setDataSource(dataSource);
		return ret;
	}

	public DatasetDefineDao getDatasetDefineDao() {
		DatasetDefineDao ret=new DatasetDefineDao();
		ret.setDataSource(dataSource);
		return ret;
	}

	public KpiDefineDao getKpiDefineDao() {
		KpiDefineDao ret=new KpiDefineDao();
		ret.setDataSource(dataSource);
		return ret;
	}

	public RawDataDao getRawDataDao() {
		RawDataDao ret=new RawDataDao();
		ret.setDataSource(dataSource);
		return ret;
	}

	public ScanJobDao getScanJobDao() {
		ScanJobDao ret=new ScanJobDao();
		ret.setDataSource(dataSource);
		return ret;
	}
	
	public BusinessQuery getBusinessQuery() {
		BusinessQuery ret=new BusinessQuery();
		ret.setDataSource(dataSource);
		ret.setDaoFactory(this);
		return ret;
	}

	public DayStatisDao getDayStatisDao() {
		DayStatisDao ret=new DayStatisDao();
		ret.setDataSource(dataSource);
		return ret;
	}
	
	public SmoothEventDao getSmoothEventDao(){
		SmoothEventDao ret=new SmoothEventDao();
		ret.setDataSource(dataSource);
		return ret;
	}
	
	public TimeCheckDao getTimeCheckDao() {
		TimeCheckDao ret=new TimeCheckDao();
		ret.setDataSource(dataSource);
		return ret;
	}
	
	public SmoothDefineDao getSmoothDefineDao(){
		SmoothDefineDao ret=new SmoothDefineDao();
		ret.setDataSource(dataSource);
		return ret;
	}

	public SmoothStrategyDao getSmoothStrategyDao() {
		SmoothStrategyDao ret=new SmoothStrategyDao();
		ret.setDataSource(dataSource);
		return ret;
	}

	public DBSourceDao getDBSourceDao() {
		DBSourceDao ret=new DBSourceDao();
		ret.setDataSource(dataSource);
		return ret;
	}

	public MsgSubDao getMsgSubDao() {
		MsgSubDao ret=new MsgSubDao();
		ret.setDataSource(dataSource);
		return ret;
	}
	
	public BaseDao getBaseDao() {
		BaseDao ret=new BaseDao();
		ret.setDataSource(dataSource);
		return ret;
	}
	
	/*
	 * get/set
	 * */
	public DataSource getDataSource() {
		return dataSource;
	}

	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}
}
